package com.lizq.rabbit.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;

/**
 * 消费者
 *
 * @author 李志强
 * @version 0.1
 * @time 2017-11-13 15:56
 * @since 0.1
 */
public class ConsumerMessageListener implements MessageListener {
    private static final Logger LOGGER = LoggerFactory.getLogger(ConsumerMessageListener.class);

    @Override
    public void onMessage(Message msg) {
        try {
            LOGGER.info("recv msg success-------------------" + msg.toString());
        } catch (Exception e) {
            LOGGER.error("recv msg failure:", e);
        }
    }

}